//
//  NotDeviceFindView.swift
//  Pods
//
//  Created by 易先生 on 2022/9/9.
//

import UIKit
import MYModule

class NotDeviceFindView: View {

	override func makeUI() {
		super.makeUI()

		self.addSubview(stackView)
		self.addSubview(retryButton)
		stackView.addArrangedSubview(notDataImageView)
		stackView.addArrangedSubview(titleLabel)
		stackView.addArrangedSubview(helpButton)
		stackView.snp.makeConstraints { make in
			make.center.equalToSuperview()
		}

		retryButton.snp.makeConstraints { make in
			make.bottom.equalToSuperview().offset(-92)
			make.height.equalTo(44)
			make.leading.equalToSuperview().offset(52)
			make.trailing.equalToSuperview().offset(-52)
		}
	}

	private lazy var stackView: UIStackView = {
		let stackView = UIStackView()
		stackView.axis = .vertical
		stackView.distribution = .fill
		stackView.spacing = 20
		stackView.alignment = .center
		return stackView
	}()

	private lazy var notDataImageView: ImageView = {
		let notDataImageView = ImageView()
		notDataImageView.image = UIImage(named: "img_nodevice_1")
		return notDataImageView
	}()

	private lazy var titleLabel: Label = {
		let titleLabel = Label()
		titleLabel.font = Fonts.systemFont(ofSize: 15)
		titleLabel.text = "binding_not_find".language
		titleLabel.textColor = UIColor.assist_222222
		return titleLabel
	}()

	public lazy var helpButton: Button = {
		let helpButton = Button()
		helpButton.titleLabel?.font = Fonts.systemFont(ofSize: 12)
		helpButton.setTitle("binding_see_help".language, for: .normal)
		helpButton.setTitleColor(UIColor.theme, for: .normal)
		return helpButton
	}()

	public lazy var retryButton: Button = {
		let retryButton = Button()
		retryButton.titleLabel?.font = Fonts.systemFont(ofSize: 12)
		retryButton.setTitle("binding_retry".language, for: .normal)
        retryButton.setTitleColor(UIColor.assist_FFFFFF, for: .normal)
        retryButton.backgroundColor = UIColor.theme
		retryButton.cornerRadius = 5.0
		return retryButton
	}()
}
